package com.song.shop.ioc;

import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Song Yinghui
 * @date 2018/11/1
 * @Version 1.0
 */
public class IocTest1 implements IocInterface{


    private static String str ;

    private Double dop ;

    @GPAutowired
    private User user1  ;



    public void test(){
        List<String> list = new ArrayList<>();
        list.add("123");
        list.add("1234");
        list.add("ss");
        list.forEach(s -> {

                try {
                    if ("1234".equals(s)) {
                        throw new Exception("ceshi ");
                    }
                    System.out.println(s);
                } catch (Exception e) {
                    e.printStackTrace();
                }

        });
    }

    public void test1(){
        String s = "com.song.shop".replaceAll("\\.", "/");
        URL resource = this.getClass().getClassLoader().getResource("" + "com.song.shop".replaceAll("\\.", "/"));
        File file = new File(resource.getFile());
        for (File f :file.listFiles()){
            if (f.isDirectory()){

            }else {
                System.out.println("-----"+f.getName());
            }
        }
    }


    public void test2(String name ){

        System.out.println("--------invoke------------");
        System.out.println(name );
        System.out.println("---str=="+str);
        System.out.println("--------------");

    }

    public static void main(String[] args) {


        new IocTest1().test();

    }
}
